package com.feng.study.util;

import com.github.stuxuhai.jpinyin.PinyinException;
import com.github.stuxuhai.jpinyin.PinyinFormat;
import com.github.stuxuhai.jpinyin.PinyinHelper;

/**
 * @Author: Zeng ShaoYong
 * @Date: 2021-09-02
 * @Description:
 */
public class JpinyinUtil {
    private static void test() {
        String[] strings = PinyinHelper.convertToPinyinArray('体');
        System.out.println(strings);
    }

    public static void main(String[] args) {
        String[] strings = PinyinHelper.convertToPinyinArray('a', PinyinFormat.WITHOUT_TONE);
        for (String string : strings) {
            System.out.println(string);
        }
//        try {
//            String s = PinyinHelper.convertToPinyinString("体重重庆重量!.123a", "", PinyinFormat.WITHOUT_TONE);
//            System.out.println(s);
//        } catch (PinyinException e) {
//            e.printStackTrace();
//        }
//        System.out.println(PinyinHelper.hasMultiPinyin('一'));
//        try {
//            String pinyin = PinyinHelper.getShortPinyin("体重重庆重量");
//            System.out.println(pinyin);
//        } catch (PinyinException e) {
//            e.printStackTrace();
//        }
    }
}
